import store from '../store'
import { movieRequest } from '../../api'
import { GETMOVIELIST } from '../constant/movieConst'

//请求movie数据后得到数据,返回type和data

//发送请求全部写在api中

export const getMovieAction = () => {
  return async () => {
    const re = await movieRequest()
    store.dispatch({
      type: GETMOVIELIST,
      data: re.data.data.list
    })
  }
}